﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Org.Mentalis.Utilities;

namespace Client
{
    class TurnOffComputer
    {
        public static void LogOff()
        {
            try
            {
                WindowsController.ExitWindows(RestartOptions.LogOff, true);
            }
            catch
            {
            }
        }

        public static void Reboot()
        {
            try
            {
                WindowsController.ExitWindows(RestartOptions.Reboot, true);
            }
            catch
            {
            }
        }

        public static void Shutdown()
        {
            try
            {
                WindowsController.ExitWindows(RestartOptions.ShutDown, true);
            }
            catch
            {
            }
        }

        public static void StandBy()
        {
            try
            {
                WindowsController.ExitWindows(RestartOptions.Suspend, true);
            }
            catch
            {
            }
        }

        public static void Hibernate()
        {
            try
            {
                WindowsController.ExitWindows(RestartOptions.Hibernate, true);
            }
            catch
            {
            }
        }

        public static void LockComputer()
        {
            try
            {
                WindowsController.ExitWindows(RestartOptions.PowerOff, true);
            }
            catch
            { }
        }
    }
}
